

var logoState = true;
var toggleLogoInterval;

var offset = 0;
var opacity;

function toggleLogo()
{	
	if (offset == 0)
	{
		offset = 250;
		toggleLogoInterval = window.setInterval("toggleLogoAnim(" + logoState + ")", 20);
		logoState = !logoState;
	}
}

function toggleLogoAnim(plogoState)
{
	var topStr = document.getElementById('main').style.top;
	var top = topStr.substring( 0, topStr.length - 2 );
	
	offset = offset / 1.4;
	opacity = (offset / 260);
	
	if (offset <= 2)
	{
		offset = 0;
		window.clearInterval(toggleLogoInterval);
	}
	
	if (plogoState)
	{	
		top = offset + 20;
	} else {
		top = 260 - offset;
		opacity = 1 - opacity;
	}
	
	document.getElementById('logo').style.filter = "alpha(opacity=" + opacity*100 + ")";
	document.getElementById('logo').style.opacity = opacity;
		
	document.getElementById('main').style.top = top+"px";
	
}